package model;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.IOException;

public class ReadBinaryData {
	public static void main(String[] args) throws IOException {
		int iVal = 0;
		double dVal = 0;
		boolean bVal = false;
		
		DataInputStream dis;
		
		try {
			FileInputStream fis = new FileInputStream("a.dat");
			dis = new DataInputStream(fis);
		}
		catch (Exception e) {
			System.out.print("Error open file.");
			return;
		}
		
		try {
			iVal = dis.readInt();
			System.out.println(iVal);
			dVal = dis.readDouble();
			bVal = dis.readBoolean();
		}
		catch (Exception e) {
			System.out.print("Error reading file.");
		}
		
		dis.close();
		
	}
}
